<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html" ;charset="gb2312">
<title>CoolMeeting会议管理系统</title>
<link rel="stylesheet" href="styles/common.css" />
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
function turnPage(currentPage){
    var employeename =$('input[name=employeename]').val();
    var username =$('input[name=username]').val();
    var employeestatus = $('input[name=employeestatus]:checked').val();
    location.href='searchEmployees?employeename='+employeename+'&username='+username+'&employeestatus='+employeestatus+'&currentpage='+currentPage;
 }
</script>
</head>
<body>
	<div class="page-header">
		<div class="header-banner">
			<img src="images/header.png" alt="CoolMeeting" />
		</div>
		<div class="header-title">欢迎访问Cool-Meeting会议管理系统</div>
		<div class="header-quicklink">
			欢迎您，<strong>${emp.employeename }</strong> <a href="changepassword.html">[修改密码]</a>
		</div>
	</div>
	<div class="page-body">
		<div class="page-sidebar">
			<div class="sidebar-menugroup">
				<div class="sidebar-grouptitle">个人中心</div>
				<ul class="sidebar-menu">
					<li class="sidebar-menuitem"><a href="notifications.jsp">最新通知</a></li>
					<li class="sidebar-menuitem active"><a href="myOrderMeeting">我的预定</a></li>
					<li class="sidebar-menuitem"><a href="mymeetings.html">我的会议</a></li>
				</ul>
			</div>
			<div class="sidebar-menugroup">
				<div class="sidebar-grouptitle">人员管理</div>
				<ul class="sidebar-menu">
					<li class="sidebar-menuitem"><a href="selectAllDepts">部门管理</a></li>
					<li class="sidebar-menuitem"><a href="register.jsp">员工注册</a></li>
					<li class="sidebar-menuitem"><a href="selectApproveAccount">注册审批</a></li>
					<li class="sidebar-menuitem"><a
						href="searchEmployees?employeestatus=1">搜索员工</a></li>
				</ul>
			</div>
			<div class="sidebar-menugroup">
				<div class="sidebar-grouptitle">会议预定</div>
				<ul class="sidebar-menu">
					<li class="sidebar-menuitem"><a href="addmeetingroom.jsp">添加会议室</a></li>
					<li class="sidebar-menuitem"><a href="selectMeetingRoom">查看会议室</a></li>
					<li class="sidebar-menuitem"><a href="bookmeeting.jsp">预定会议</a></li>
					<li class="sidebar-menuitem"><a href="selectMeetingPage">搜索会议</a></li>
				</ul>
			</div>
		</div>
		<div class="page-content">
			<div class="content-nav">会议预定 > 搜索员工</div>
			<form action="searchEmployees">
				<fieldset>
					<legend>搜索会议</legend>
					<table class="formtable">
						<tr>
							<td>姓名：</td>
							<td><input type="text" name="employeename" maxlength="20"
								value="${param.employeename }" /></td>
							<td>账号名：</td>
							<td><input type="text" name="username" maxlength="20"
								value="${param.username }" /></td>
							<td>状态：</td>
							<td><c:choose>
									<c:when test="${param.employeestatus ==0}">
										<input type="radio" id="status" name="employeestatus"
											value="1" />
										<label>已批准</label>
										<input type="radio" id="status" name="employeestatus"
											value="0" checked="checked" />
										<label>待审批</label>
										<input type="radio" id="status" name="employeestatus"
											value="3" />
										<label>已关闭</label>
									</c:when>
									<c:when test="${param.employeestatus ==3}">
										<input type="radio" id="status" name="employeestatus"
											value="1" />
										<label>已批准</label>
										<input type="radio" id="status" name="employeestatus"
											value="0" />
										<label>待审批</label>
										<input type="radio" id="status" name="employeestatus"
											value="3" checked="checked" />
										<label>已关闭</label>
									</c:when>
									<c:otherwise>
										<input type="radio" id="status" name="employeestatus"
											value="1" checked="checked" />
										<label>已批准</label>
										<input type="radio" id="status" name="employeestatus"
											value="0" />
										<label>待审批</label>
										<input type="radio" id="status" name="employeestatus"
											value="3" />
										<label>已关闭</label>
									</c:otherwise>
								</c:choose></td>
						</tr>
						<tr>
							<td colspan="6" class="command"><input type="submit"
								class="clickbutton" value="查询" /> <input type="reset"
								class="clickbutton" value="重置" /></td>
						</tr>
					</table>
				</fieldset>
			</form>
			<div>
				<h3 style="text-align: center; color: black">查询结果</h3>
				<div class="pager-header">
					<div class="header-info">
						共<span class="info-number">${page.recordCount }</span>条结果， 分成<span
							class="info-number">${page.pageCount }</span>页显示， 当前第<span
							class="info-number">${page.currentPage }</span>页
					</div>
					<div class="header-nav">
						<input type="button" class="clickbutton" value="首页"
							onclick="turnPage(1)" /> <input type="button" class="clickbutton"
							value="上页" onclick="turnPage(${page.currentPage-1 })" /> <input
							type="button" class="clickbutton" value="下页"
							onclick="turnPage(${page.currentPage+1 })" /> <input
							type="button" class="clickbutton" value="末页"
							onclick="turnPage(${page.pageCount })" /> 跳到第<input type="text"
							id="pagenum" class="nav-number" />页 <input type="button"
							class="clickbutton" value="跳转"
							onclick="turnPage(document.getElementById('pagenum').value)" />
					</div>
				</div>
			</div>
			<table class="listtable">
				<tr class="listheader">
					<th>姓名</th>
					<th>账号名</th>
					<th>联系电话</th>
					<th>电子邮件</th>
					<th>操作</th>
				</tr>
				<c:if test="${! empty emps }">
					<c:forEach items="${emps }" var="emp">
						<tr>
							<td>${emp.employeename }</td>
							<td>${emp.username }</td>
							<td>${emp.phone }</td>
							<td>${emp.email }</td>
							<td><a class="clickbutton"
								href="closeAccount?employeeid=${emp.employeeid }&employeestatus=3">关闭账号</a></td>
						</tr>
					</c:forEach>
				</c:if>
			</table>
		</div>
	</div>
	<div class="page-footer">
		<hr />
		更多问题，欢迎联系<a href="mailto:webmaster@eeg.com">管理员</a> <img
			src="images/footer.png" alt="CoolMeeting" />
	</div>
</body>
</html>